# -*- coding: utf-8 -*-


import openpyxl

# 打开 Excel 文件
workbook = openpyxl.load_workbook('D:\downloads\批量修改年假清零时间-模板 (3).xlsx')

# 选择要操作的工作表
sheet = workbook['Sheet3']  # 替换成你的工作表名称

# 读取第2列和第3列的数据
column_2_data = []
column_3_data = []

c1=sheet["B"]
c2=sheet["C"]
for i in c1:
    if i==sheet["B1"]:
        continue
    else:
        column_2_data.append(i.value)

for i in c2:
    if i==sheet["C1"]:
        continue
    else:
        column_3_data.append(i.value)

row_data=[]
r=sheet['4']
print(r)
for i in r:
    row_data.append(i.value)
# 输出读取到的数据
print("第2列数据：", column_2_data)
print("第3列数据：", column_3_data)
print("第4行数据：",row_data)
# print(sheet.rows)
# for i in sheet.rows:
#     for j in i:
#         print(j.value)

# for m in sheet.columns:
#     for n in m:
#         print(n.value)
#
# # 关闭 Excel 文件
# workbook.close()


